<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['环卫管理','数据报表','清运明细']" icon="fa fa-cube" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>

	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>清运明细</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">								
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
								<div class="top_module">
									<span class="module_text">区域名称</span>
									<select name="" id="" class="module_inp" [(ngModel)]="areaName" style="width: 120px;" (change)='getStationByArea()'>
										<option value="">全部</option>
										<option *ngFor="let item of allAreaList" [attr.value]='item.areaName'>{{item.areaName}}</option>
									</select>
								</div>
								
								<div class="top_module">
									<span class="module_text">站点名称</span>
									<select name="" id="" class="module_inp" [(ngModel)]="siteName" style="width: 120px;">
										<option value="">全部</option>
										<option *ngFor="let item of allStationList" [attr.value]='item.stationName'>{{item.stationName}}</option>
									</select>
								</div>								
								
								<div class="selectDate top_module">
									<table-select-date [notInit]="true" (outerTime)="getSelectTableTime($event)" ></table-select-date>
								</div>
								<button type="button" class="btn btn-primary" (click)="search_data()">查询</button>
								<button type="button" class="btn btn-primary" (click)="exportData()">导出</button>

							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>车牌号码</th>
										<th>站点名称</th>
										<th>区域名称</th>
										<th>垃圾分类</th>
										<th>重量[千克]</th>
										<th>时间</th>
										<th>司机</th>
										<th>地址</th>
										<th *ngIf="isDelete||isEdit">操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i"   >
										<td>{{row.carNumber}}</td>
										<td>{{row.stationName}}</td>
										<td>{{row.areaName}}</td>
										<td>{{row.garbageType}}</td>
										<td>{{row.weight}}</td>
										<td>
										    {{row.weightUploadTime||row.uploadTime}}
										</td>
										<td>{{row.driver}}</td>
										<td>{{row.address}}</td>
										<td *ngIf="isDelete||isEdit">
											<button *ngIf="isEdit" type="button" (click)="myModal.show();edit_row(row)">编辑</button>
											<button *ngIf="isDelete" type="button" (click)="delete_row(row)">删除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<!-- 编辑弹窗 -->
	<div bsModal #myModal="bs-modal" class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="myModal.hide()">
						&times;
					</button>
					<h4 class="modal-title" id="">编辑运输信息</h4>
				</div>
				<div class="modal-body col-xs-12" style="padding-left: 0;">
					<form action="" class="form-horizontal">
						<div class="form-group s_fix_select2">
							<label class="control-label col-sm-2 no-padding-right">车牌号码</label>
							<div class="col-sm-10">
								<div class="form-control" disabled>
									{{editRowParams.carNumber}}
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2 no-padding-right">站点名称</label>
							<div class="col-sm-10">
								<div class="clearfix">
									<input class="form-control" [(ngModel)]="editRowParams.stationName" name="stationName">
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2 no-padding-right">区域名称</label>
							<div class="col-sm-10">
								<div class="clearfix">
									<input class="form-control" [(ngModel)]="editRowParams.areaName" name="areaName">
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2 no-padding-right">重量[千克]</label>
							<div class="col-sm-10">
								<div class="clearfix">
									<input class="form-control" [(ngModel)]="editRowParams.weight" name="weight" type="number" />
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2 no-padding-right">时间</label>
							<div class="col-sm-10">
								<div class="clearfix">
									<input class="form-control" [(ngModel)]="editRowParams.uploadTime" name="uploadTime">
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2 no-padding-right">司机</label>
							<div class="col-sm-10">
								<div class="clearfix">
									<input class="form-control" [(ngModel)]="editRowParams.driver" name="driver">
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2 no-padding-right">地址</label>
							<div class="col-sm-10">
								<div class="clearfix">
									<input class="form-control" [(ngModel)]="editRowParams.address" name="address">
								</div>
							</div>
						</div>
						
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" (click)="myModal.hide()">关闭</button>
					<button type="button" class="btn btn-primary" (click)='submitUpdate(myModal)'>更新</button>
				</div>
			</div>
		</div>
	</div>

</div>